package xmlrpc.spring.config;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by ly on 2015/8/20.
 */
@Component
public class AppConfigurableEmbedded implements EmbeddedServletContainerCustomizer {

    @Resource
    private AppConfig config;

    @Override
    public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) {
        configurableEmbeddedServletContainer.setPort(config.getServerPort());
    }
}
